import 'package:aio/aio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:app/generated/app_strings.dart';
import 'package:app/src/http/bean/wroks/contract_bean.dart';
import 'package:app/src/ui/dialog/dailog.dart';
import 'package:app/src/ui/route/works/public/items/ui_base.dart';
import 'package:app/src/ui/route/works/public/items/ui_card.dart';
import 'package:app/src/ui/route/works/type18_contract_royalty_rate_apply_check/item/ui_contractroyaltyrateapplycheckchange.dart';

import '../../../../../http/bean/works_2023/contractroyaltyrateapplycheck_bean.dart';
import '../../../../../http/bean/works_2023/report_loss_bean.dart';

///报损审核（基本信息）
class UiRportLoss {
  ///data 信息
  ///oldData 历史信息
  static Widget build(
      BuildContext context, FLoseApplyInfoBean? data, FLoseApplyInfoBean? oldData,
      {String? title}) {
    List<Widget> children = [];
    if (StringUtils.isEmpty(title)) {
      title = AppStrings.of(context).BaseInfo; //基本信息
    }
    children.add(UiBase.title(context, title)); //标题
    children.add(UiBase.item(
      context,
      AppStrings.of(context).ApplicationCode,
      data?.ApplicationCode,
      oldData?.ApplicationCode,
    )); //申请单号
    children.add(UiBase.item(
        context,
        AppStrings.of(context).Applicationdatetime,
        data?.Applicationdatetime,
        oldData?.Applicationdatetime)); //申请日期
    children.add(UiBase.item(context, AppStrings.of(context).MerchandiserName2,
        data?.MerchandiserName, oldData?.MerchandiserName)); //跟单员
    children.add(UiBase.item(context, AppStrings.of(context).SalesmanName2,
        data?.SalesmanName, oldData?.SalesmanName)); //业务员
    children.add(UiBase.item(
      context,
      AppStrings.of(context).ContractCode,
      data?.getContractCode(),
      oldData?.getContractCode(),
    )); //合同编号
    children.add(UiBase.item(context, AppStrings.of(context).ProjectName,
        data?.ProjectName, oldData?.ProjectName)); //项目名称
    children.add(UiBase.item(context, AppStrings.of(context).CustomerName,
        data?.CustomerName, oldData?.CustomerName)); //客户名称
    children.add(UiBase.item(context, AppStrings.of(context).FactoryName,
        data?.FactoryName, oldData?.FactoryName)); //生产工厂
    children.add(UiBase.item(context, AppStrings.of(context).Acount,
        data?.Amount, oldData?.Amount)); //金额
    children.add(UiBase.item(context, AppStrings.of(context).BaosunBeizhu,
        data?.Beizhu, oldData?.Beizhu)); //报损说明
    var column = UiBase.column(context, children);
    var card = UiCard.build(context, column);
    return card;
  }
}
